<?php
include("../inc/db_connect.php");
if ($_POST['term']==1)
    $uloz_u = "UPDATE dochadzkazamfalk SET planOd = '".$_POST['value']."' WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
if ($_POST['term']==2)
    $uloz_u = "UPDATE dochadzkazamfalk SET planDo = '".$_POST['value']."' WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
if ($_POST['term']==3)
    $uloz_u = "UPDATE dochadzkazamfalk SET realOd = '".$_POST['value']."' WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
if ($_POST['term']==4)
    $uloz_u = "UPDATE dochadzkazamfalk SET realDo = '".$_POST['value']."' WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
if ($_POST['term']==5)
    $uloz_u = "UPDATE dochadzkazamfalk SET splitOd = '".$_POST['value']."' WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
if ($_POST['term']==6)
    $uloz_u = "UPDATE dochadzkazamfalk SET splitDo = '".$_POST['value']."' WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
//echo $uloz_u;
$uloz_q = MySQL_Query ($uloz_u);

$nac_s = "SELECT * FROM dochadzkazamfalk WHERE zid = '".$_POST['zid']."' AND date='".$_POST['date']."' ";
$nac_q = MySQL_Query ($nac_s);
$nac = MySQL_Fetch_Array ($nac_q);
if (($nac['realOd']!='')&&($nac['realDo']!='')){
    echo 1;
} else {
    echo 0;
}
?>
